package com.zyj.myapplication.Model;

import com.zyj.myapplication.Service.ClubService;

import retrofit2.Call;
import retrofit2.Retrofit;
import retrofit2.converter.gson.GsonConverterFactory;

/**
 * Created by Administrator on 2017/9/26.
 */

public class ClubModel {
    private Retrofit retrofit;
    private ClubService clubService;

    public ClubModel() {
        retrofit = new Retrofit
                .Builder()
                .baseUrl(Constant.BASE_URL)
                .addConverterFactory(GsonConverterFactory.create())
                .build();
    }

    private void service() {
        clubService = retrofit.create(ClubService.class);
    }

    public Call getAllclub() {
        service();
        return clubService.getAllclub();
    }

    public Call getClubInfo(String id) {
        service();
        return clubService.getClubInfo("lgj98rfkiqvenhrk2o7oe2po81", "1", "Clubteacher", "club", id);
    }

    public retrofit2.Call<Integer> getClubState(String fan_id, int userid) {
        service();
        return clubService.getClubState(fan_id, userid, "1", "lgj98rfkiqvenhrk2o7oe2po81");
    }

    public retrofit2.Call<Integer> changeClubState(int userid, String fan_id) {
        service();
        return clubService.changeClubState("lgj98rfkiqvenhrk2o7oe2po81", userid, fan_id, "1");
    }

    public Call<Integer> Nocollect(String club_id, int user_id) {
        service();
        return clubService.Nocollect("clubfans", club_id, user_id, "lgj98rfkiqvenhrk2o7oe2po81");
    }

    public Call getClubClass(String id) {
        service();
        return clubService.getClubClass("lgj98rfkiqvenhrk2o7oe2po81", "1", "Clubcourse", "club", id);
    }

    public Call getClubVideo(String id) {
        service();
        return clubService.getClubVideo("lgj98rfkiqvenhrk2o7oe2po81", "1", "Clubvideo", "club", id);
    }


}
